import pyautogui
import time

print("Auto clicker will start in 5 seconds...")
print("Move your mouse to the target position.")
print("To stop, press Ctrl+C or move mouse to top-left corner.")
time.sleep(5)

try:
    while True:
        pyautogui.click()
        print("Clicked at", pyautogui.position())
        time.sleep(2)
except KeyboardInterrupt:
    print("\nAuto clicker stopped by user.")
except pyautogui.FailSafeException:
    print("\nAuto clicker stopped by fail-safe.")
